from 第三章.deque import Deque


def pal_checker(s):
    char_deque = Deque()

    for ch in s:
        char_deque.add_rear(ch)

    status = True

    while char_deque.size() > 1 and status:
        first = char_deque.remove_front()
        last = char_deque.remove_rear()
        if first != last:
            status = False

    return status


if __name__ == '__main__':
    s = 'radar'
    print(pal_checker(s))